# Contributor: Celeste <cielesti@protonmail.com>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=emacs-iter2
pkgver=1.4
pkgrel=0
_pkgreal=iter2
pkgdesc="Reimplementation of Elisp generators"
url="https://github.com/doublep/iter2"
arch="noarch"
license="GPL-3.0-or-later"
depends="cmd:emacs"
makedepends="emacs-nox"
source="https://github.com/doublep/iter2/archive/$pkgver/emacs-iter2-$pkgver.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver"

build() {
	emacs -batch -q -no-site-file -L . \
		-eval '(setq byte-compile-error-on-warn t)' \
		-f batch-byte-compile \
		./*.el
}

check() {
	emacs -batch -q -no-site-file -L . -L test \
		-l iter2-test -f ert-run-tests-batch-and-exit
}

package() {
	install -Dvm644 ./*.el ./*.elc \
		-t "$pkgdir"/usr/share/emacs/site-lisp/

	cd "$pkgdir"/usr/share/emacs/site-lisp
	emacs -batch -q -no-site-file \
		-eval "(loaddefs-generate \".\" \"$_pkgreal-loaddefs.el\")"
}

sha512sums="
3fe6827388e61f6ce39aded0fc844d8aeea6bcef098ae226460632065bcaf33758cc5bfdab2c0eabd3c5d77c5fea93db714d375f1aee7daecc3a623789ed639c  emacs-iter2-1.4.tar.gz
"
